<include file="public@header" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/animation.css">

<style>
    .table img{
        width:50px;
    }
    .layui-table[lay-size=lg] td, .layui-table[lay-size=lg] th{
        padding: 10px 10px;
    }
</style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">

        <div class="layui-page-header">
            <div class="layui-card">
                <div class="layui-page-header-content">
                    <div class="layui-card-body">
                        <div class="layui-ui-page-header-title" >
                            <span class="layui-badge-rim page-content">新闻列表</span>
                        </div>
                    </div>
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title layui-nav" id="tabHeader">
                            <li class="layui-this layui-nav-item"><a href="{:url('news/index')}">列表</a></li>
                            <li class="layui-nav-item"><a href="{:url('news/add')}">{:lang('ADD')}</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" method="post" action="{:url('news/index')}">
                        <div class="layui-form-item layuiadmin-card-text" style="margin-bottom: 0;">

                            <div class="layui-inline">
                                <label class="layui-form-label">发布时间</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input js-bootstrap-date" name="start_time"
                                           value="{:input('request.start_time')}"
                                           autocomplete="off" placeholder="开始日期">
                                </div>
                                <div class="layui-form-mid">-</div>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input js-bootstrap-date" name="end_time"
                                           value="{:input('request.end_time')}"
                                           autocomplete="off" placeholder="结束日期">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">关键字</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="keyword" value="{:input('request.keyword')}" placeholder="请输入关键字">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input type="submit" class="layui-btn btn-primary" value="搜索" />
                                    <a class="layui-btn layui-btn-danger btn-danger" href="{:url('news/index')}">清空</a>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div class="layui-page-content">
            <div class="layui-card">
                <form method="post" class="layui-card-body js-ajax-form" action="{:url('news/listOrder')}">
                    <button class="layui-btn js-ajax-submit" type="submit">{:lang('SORT')}</button>
                    <table class="layui-table treeTable" id="menus-table" lay-even lay-skin="nob" lay-size="lg">
                        <thead>
                        <tr>
                            <th>{:lang('SORT')}</th>
                            <th>ID</th>
                            <th>标题</th>
                            <th>封面</th>
                            <th>浏览次数</th>
                            <th>添加时间</th>
                            <th align="center">{:lang('ACTIONS')}</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="list" item="vo">
                            <tr>
                                <td>
                                    <input name="list_orders[{$vo.id}]" class="layui-input" type="text" value="{$vo.list_order}">
                                </td>
                                <td>{$vo['id']}</td>
                                <td>{$vo['name']}</td>
                                <td><if condition="$vo['thumb']"><img src="{$vo['thumb']}"></if></td>
                                <td>{$vo['views']}</td>
                                <td>{:date('Y-m-d H:i:s',$vo['addtime'])}</td>

                                <td>

                                    <div class="new-divider new-divider-vertical"></div>

                                    <a class="layui-bo layui-bo-small layui-bo-checked" href="{:url("news/edit",array("id"=>$vo["id"]))}">{:lang('EDIT')}</a>
                                    <div class="new-divider new-divider-vertical"></div>
                                    <a class="layui-bo layui-bo-small layui-bo-close js-ajax-delete" href="{:url('news/del',array('id'=>$vo['id']))}" <if condition="$vo['views'] gt 0">data-msg="确定要删除么？"</if>>{:lang('DELETE')}</a>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>

                </form>
            </div>
        </div>

    </div>

</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>